package jp.idahopotato.activity;

import jp.idahopotato.bean.Result;
import jp.matome.activity.R;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;

public class ResultDetailActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO 自動生成されたメソッド・スタブ
		super.onCreate(savedInstanceState);
		setContentView(R.layout.resultdetail);

		Intent data = getIntent();
		Result rs = (Result)data.getParcelableExtra("SELECTED_ITEM");
		//Result rs = (Result)data.getSerializableExtra("SELECTED_ITEM");

		TextView head = (TextView)findViewById(R.id.headname);
		head.setText(rs.getHead());
		TextView body = (TextView)findViewById(R.id.bodyname);
		body.setText(rs.getBody());
		TextView arm = (TextView)findViewById(R.id.armname);
		arm.setText(rs.getArm());
		TextView west = (TextView)findViewById(R.id.westname);
		west.setText(rs.getWest());
		TextView leg = (TextView)findViewById(R.id.legname);
		leg.setText(rs.getLeg());

		ListView jeweLlist = (ListView)findViewById(R.id.android_list1);
		ArrayAdapter<String> jewelAdapter = new ArrayAdapter<String>(ResultDetailActivity.this, android.R.layout.simple_list_item_1);
		for(String str : rs.getJewels()){
			if(!str.equals("")){
				jewelAdapter.add(str);
			}
		}
		jeweLlist.setAdapter(jewelAdapter);

		ListView skillPointList = (ListView)findViewById(R.id.android_list2);
		ArrayAdapter<String> skillPointAdapter = new ArrayAdapter<String>(ResultDetailActivity.this, android.R.layout.simple_list_item_1);
		for(String str : rs.getSkills()){
			if(!str.equals("")){
				skillPointAdapter.add(str);
			}
		}
		skillPointList.setAdapter(skillPointAdapter);
	}


}
